package com.test.realcityalfa.connection;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.message.BasicNameValuePair;

import android.net.Uri;

import com.test.realcityalfa.Constants;

public class GetRequestMethod implements RequestMethod{

	
	private String getUriWithParams(String jsonData) {
		return new Uri.Builder().
				scheme(Constants.InternetConnection.URL_SCHEME).
				authority(Constants.InternetConnection.URL_AUTHORITY).
				path(Constants.InternetConnection.URL_PATH).
				appendQueryParameter(Constants.InternetConnection.URL_GET_PARAMETER_NAME, jsonData).
				build().toString();
	}
	
	public String appendParameter(Uri uri, BasicNameValuePair data)
	{
		Uri.Builder builder = uri.buildUpon();
		builder.appendQueryParameter(data.getName(), data.getValue());
		return builder.toString();
	}

	@Override
	public Object getHttpMethod(String jsonData) {
		// TODO Auto-generated method stub
		return new HttpGet(getUriWithParams(jsonData));
	}

}
